<!DOCTYPE html>
<html lang="zh-cn">
<head>
	{include file="common/header" /}
	{include file="common/css" /}
	{include file="common/js" /}
</head>

<body>
    <div id="wrapper">
		{include file="common/dialog" /}
		
        <!-- Navigation -->
		{include file="common/navbar" /}

        <div id="page-wrapper">
            <!-- 内容部分 -->
			
			<div class="row" id="first_row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">编辑-{$data.name}</div>
                        <div class="panel-body">
                            <div class="form-group">
								<textarea id="content" name="content">{$data.content}</textarea>
							</div>
							<div class="form-group" id="btn_submit_div">
								<input id="id" name="id" type="hidden" value="{$data.id}" />
								<button type="button" id="btn_submit" class="btn btn-outline btn-primary">更新</button>
							</div>
                        </div>
                    </div>
                </div>              				
            </div>
			<script src="{$Think.config.web_res_root}mgr/js/art_single/get.js"></script>
<script>
$(function() {
			
	$('#content').ckeditor({ 
		height: '450px' 
	});
	$("#btn_submit").click(function() {
		
		var data = {
			id: $("#id").val(),
			content: CKEDITOR.instances.content.getData()
		};
		
		$.ajax({
			url: cfg.web_root + "mgr/art_single/get",
			type: "post",
			dataType: "json",
			data: data,
			beforeSend: function() {
				$("#btn_submit").attr("disabled", true);
			},
			success: function(res, status) {
				
				$("#dialog_alert").find(".modal-body").html(res.msg);
				$("#dialog_alert").modal('show');
				
			},
			complete: function() {
				$("#btn_submit").attr("disabled", false);
			}
		});
		
		return false;
	});
});
</script>
        </div>
        <!-- /#page-wrapper -->

    </div>
    <!-- /#wrapper -->
</body>

</html>
